#include "widget02.h"
#include "ui_widget02.h"

Widget02::Widget02(QWidget *parent) :
    QWidget(parent),
    ui(new Ui::Widget02)
{
    ui->setupUi(this);
    // 单个添加项
            ui->comboBox->addItem("陕西省");
            ui->comboBox->addItem("浙江省");

            // 或者使用字符串列表添加多个项
            QStringList items;
            items << "西安市" << "宝鸡市" << "金华市";
            ui->comboBox_2->addItems(items);

            // 或者使用字符串列表添加多个项
            QStringList items2;
            items2 << "长安区" << "渭滨区" << "不知道区";
            ui->comboBox_3->addItems(items2);
}

Widget02::~Widget02()
{
    delete ui;
}
void Widget02::on_comboBox_currentIndexChanged(const QString &arg1)
{
    QString str=ui->comboBox->currentText();
    ui->lineEdit_2->setText(str);
}

void Widget02::on_comboBox_2_currentIndexChanged(const QString &arg1)
{
    QString str=ui->comboBox_2->currentText();
    ui->lineEdit_3->setText(str);
}


void Widget02::on_comboBox_3_currentIndexChanged(const QString &arg1)
{
    QString str=ui->comboBox_3->currentText();
    ui->lineEdit_4->setText(str);
}
